package com.tryoneone.staff_manager.controller;

import com.tryoneone.staff_manager.entity.AUserTable;
import com.tryoneone.staff_manager.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/user")
public class  UserController {
    @Autowired
    private UserService userService;

    @GetMapping("/list")
    public String getAllUser(){
        List<AUserTable> list = userService.selectAllUser();
        for (AUserTable user:list) {
            System.out.println(user.getAname() + user.getApwd());
        }
        return "index";
    }
}
